<?php
namespace app\mobile\logic;
use think\Model;
class Article extends Model
{
	public function articlList($map=array(), $order='id DESC', $limit=10 )
	{
        $obj = $this->where(array('is_delete' => 1))->where($map)->order($order)->paginate($limit);
        $list= $obj->toArray();
        $page= $obj->render();
        $data ['list'] = $list ['data'];
        $data ['page'] = $page;
        return $data;
	}

	public function articlDetails($id)
	{
        $data = $this::get($id);
        if((!isset($data['is_delete']) || $data['is_delete'] == -1) || $data == null) {
            return -1; //数据已删除;
        } else {
            return $data->toArray();
        }
	}
}